package basetest;

import org.junit.Test;

import static utils.JDBCUtils.updateDatabase;


/**
 * @author DuJiabao
 * @create 2021-01-15 19:28
 */
public class CreateTableTest {
    @Test
    public void test() {
        createTable("new_database", "table_with_photo");
    }

    public static void createTable(String database, String name) {
        String sql = "use " + database + ";";
        updateDatabase(sql);
        sql = "drop table if exists " + name + ";";
        updateDatabase(sql);
        sql = "create table " + name + " (name varchar(20), photo blob); ";
        updateDatabase(sql);
    }
}
